package com.ticket.sass.common.entity.tenant;

import com.baomidou.mybatisplus.annotation.*;
import com.ticket.sass.common.entity.tenant.enums.CommodityCloudPrinterType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author ywb
 * @since 2024-04-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("commodity_cloud_printers")
@ApiModel(value="CommodityCloudPrintersEntity对象", description="")
public class CommodityCloudPrinterEntity implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "名称")
    private String name;
    
    @ApiModelProperty(value = "类型")
    private CommodityCloudPrinterType type;
    
    @ApiModelProperty(value = "json数据")
    private String data;

    @ApiModelProperty(value = "影院 id")
    private Long cinemaId;

    @ApiModelProperty(value = "租户 id")
    private Long tenantId;
    
    @TableField(value = "is_default")
    private Boolean isDefault;
    
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    public LocalDateTime createdAt;
    
    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    public LocalDateTime updatedAt;
    
    @TableField(select = false)
    @ApiModelProperty(value = "删除时间")
    @TableLogic(value = "null", delval = "now()")
    public LocalDateTime deletedAt;
    
    public CommodityCloudPrinterEntity() {
    }
    
    public CommodityCloudPrinterEntity(Long id, String name, Short type, String data, Boolean isDefault) {
        this.id = id;
        this.name = name;
        this.type = CommodityCloudPrinterType.Companion.valueOf(type);
        this.data = data;
        this.isDefault = isDefault;
    }
    
    public CommodityCloudPrinterEntity(String name, Short type, String data, Boolean isDefault) {
        this.name = name;
        this.type = CommodityCloudPrinterType.Companion.valueOf(type);
        this.data = data;
        this.isDefault = isDefault;
    }
}
